package paint;

import java.awt.List;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class hash {
	public static void main(String[] args){
		
		HashMap<Integer, LinkedList<String>> test = new HashMap<Integer, LinkedList<String>>();
		LinkedList<String> a = new LinkedList<String>();
		a.add("a");
		a.add("b");
		
		LinkedList<String> b = new LinkedList<String>();
		b.add("c");
		b.add("d");
		
		
		test.put(1, a);
		test.put(2, b);
		
		LinkedList<String> dd = test.get(1);
		for (int i = 0; i<dd.size(); i++){
			System.out.println(dd.get(i));
		}
		
		Set<Map.Entry<Integer, LinkedList<String>>> entry = test.entrySet();
		
		for (Map.Entry<Integer, LinkedList<String>> s : entry){
			if (s.getKey() == 1){
				LinkedList<String> d = s.getValue();
				d.addLast("fff");
			}
		}
		
		for (int i = 0; i<dd.size(); i++){
			System.out.println(dd.get(i));
		}
		
	}
}
